import Vue from 'vue'
Vue.directive('imgerror', {
  inserted(el, binding, vnode) {
    // console.log('inserted');
    if (!el.src) {
      el.src = binding.value
    }
    el.onerror = function() {
      el.src = binding.value
    }
  },
  update(el, binding, vnode, oldVnode) {
    if (!el.src) {
      el.src = binding.value
    }
  }

})
